package com.student.demo.service.impl;

import com.student.demo.dao.MessageDao;
import com.student.demo.entiy.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class MessageService implements com.student.demo.service.MessageService {

    @Autowired
    private MessageDao messageDao;

    @Override
    public void addMessage(Message message) {
        messageDao.addMessage(message.userName, message.message);
    }

    @Override
    public List<Message> queryMessage() {
        return messageDao.queryMessage();
    }
}
